package org.qloudgen.borg.pages.compnent;

import java.util.List;
import java.util.Map;

import org.apache.wicket.markup.html.form.ChoiceRenderer;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.model.IModel;

public class ParamDropDownChoice extends DropDownChoice<String> {

	private static final long serialVersionUID = 1L;
	private Map<String,String> names ;
	
	public ParamDropDownChoice(String id , IModel<String> model, List<String> values, Map<String,String> names) {
		super(id,model,values);
		this.names = names;
		addRenderr();
	}

	private void addRenderr() {
		
		IChoiceRenderer<Object> render = new ChoiceRenderer<Object>(){
			private static final long serialVersionUID = 1L;
			public Object getDisplayValue(Object object) {
				return names.get(object);
			}
		};
		this.setChoiceRenderer(render);
	}
	
}
